using Asp.Versioning;
using Asp.Versioning.OData;
using Microsoft.OData.ModelBuilder;
using OData.Shared.Models;

namespace OData.WebApi.Configuration;

public class CustomerModelConfiguration : IModelConfiguration
{
	public void Apply(ODataModelBuilder builder, ApiVersion apiVersion, string? routePrefix)
	{
		var customer = builder.EntitySet<Customer>("Customers").EntityType;
		customer.HasKey(c => c.Id);
		customer.HasMany(c => c.Orders);
		builder.ComplexType<Address>();
		//Todo: Add Function configuration and Action configuration
	}
}
